<?php
	$tableConfig = 'tbl_content';
	if (isset($_POST['btSend'])){
		$name      = trim($_POST['txtName']);
		$email  = trim($_POST['txtEmail']);	//hien chua su dung
		$ques   = trim($_POST['txtContent']);	
		$title   = trim($_POST['txtTitle']);	//chua su dung
		//$content_id = trim($_POST['txtContenID']);
		$code = "vn_".$_GET['code'];
		$sql_getParentID = "select id from tbl_content_category where code='".$code."'";
		echo $sql_getParentID;
		$tmp = mysql_query($sql_getParentID);
		$row = mysql_fetch_assoc($tmp);
		$parentID = $row['id'];
		
		$sql = "insert into ".$tableConfig." (name, parent, detail_short, date_added, status) values ('".$name."',".$parentID.",'".$ques."',now(), 1)";
		echo $sql;
		mysql_query($sql);
		}
?>
   	        
        <div class="module">
          <div class="titlesitebar">ĐẶT CÂU HỎI CỦA BẠN</div>
          <form id="faq" name="frmContact" action="./?frame=train_inf&code=faq" method="post">
          	<input name="txtName" type="text" value="Họ và tên" class="full" />
            <input name="txtEmail" type="text" value="Email" class="full" />
            <input name="txtCode" type="text" value="Mã xác nhận" class="code" />
            <img src="Images/image.gif" width="54" height="26" align="absbottom" />
            <a href="#" class="refresh"><input name="Submit" type="submit" id="button" value="" /></a>
            <div id="clearone"></div>
            <input name="Off" type="radio" value="Off" class="rdtype" />
            <label for="radio">Off</label>
             <input name="radio" type="radio" id="radio" value="radio" checked="checked" class="rdtype" />
            <label for="radio">Telex</label>
            <input type="radio" name="radio" id="radio" value="radio" class="rdtype" />
            <label for="radio">VNI</label>
            <input type="radio" name="radio" id="radio" value="radio" class="rdtype" />
            <label for="radio">VIQR</label>
            <input name="txtTitle" type="text" value="Tiêu đề" class="full" />
            <textarea name="txtContent" cols="" rows="5" class="full">Nội dung</textarea>
			<div class="btright">
				<a href="" class="reset">
					<input name="" type="reset" value="Reset" />
				</a> 
				
					<input name="btSend" type="submit" value="Submit" onclick="return btnSend_onclick()"/>
				
			</div>
          </form>
        </div>
        <!--endmodule-->